﻿Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Public Class LandschaftstexturStrand
    Inherits ObjektLandschaftsTextur

    Dim Mesh As Objekt3D

    Public Sub New()
        ID = "STRAND"
        Landschaftsname = "Strand"
        Deckung = 0
        Tarnung = False
        KP = -1
        If DataSettings.draw3D Then
            Frame = True
        Else
            Select Case DataSettings.TerrainStyle
                Case TerrainStyle.AdvanceWarsDC, TerrainStyle.CommanderWars2
                    Frame = False
                Case Else
                    Frame = True
            End Select
        End If

        Select Case DataSettings.TerrainStyle
            'Case TerrainStyle.AdvanceWars, TerrainStyle.AdvanceWars2, TerrainStyle.CommanderWars, TerrainStyle.CustomWars
            '    TexturenLaden(New String() {"Strand_", _
            '                               "Strand+N_", "Strand+N_+S", "Strand+N_+W", "Strand+N_+O", "Strand+N_+O+S", "Strand+N_+O+W", "Strand+N_+S+W", "Strand+N_+O+S+W", _
            '                               "Strand+N+O_", "Strand+N+O_+S", "Strand+N+O_+W", "Strand+N+O_+S+W", _
            '                               "Strand+N+O+S_", "Strand+N+O+S_+W", _
            '                               "Strand+N+O+W_", "Strand+N+O+W_+S", _
            '                               "Strand+N+S+W_", "Strand+N+S+W_+O", _
            '                               "Strand+N+W_", "Strand+N+W_+O", "Strand+N+W_+S", "Strand+N+W_+O+S", _
            '                               "Strand+O_", "Strand+O_+N", "Strand+O_+S", "Strand+O_+W", "Strand+O_+N+S", "Strand+O_+N+W", "Strand+O_+S+W", "Strand+O_+N+S+W", _
            '                               "Strand+O+S_", "Strand+O+S_+N", "Strand+O+S_+W", "Strand+O+S_+N+W", _
            '                               "Strand+O+S+W_", "Strand+O+S+W_+N", _
            '                               "Strand+S_", "Strand+S_+N", "Strand+S_+O", "Strand+S_+W", "Strand+S_+N+O", "Strand+S_+N+W", "Strand+S_+O+W", "Strand+S_+N+O+W", _
            '                               "Strand+S+W_", "Strand+S+W_+N", "Strand+S+W_+O", "Strand+S+W_+N+O", _
            '                               "Strand+W_", "Strand+W_+N", "Strand+W_+S", "Strand+W_+O", "Strand+W_+N+O", "Strand+W_+N+S", "Strand+W_+O+S", "Strand+W_+N+O+S", _
            '                               "Strand+N+O+S+W_", _
            '                               "STRAND+N+S_", "STRAND+N+S_+O", "STRAND+N+S_+W", "STRAND+N+S_+O+W", _
            '                               "STRAND+O+W_", "STRAND+O+W_+N", "STRAND+O+W_+S", "STRAND+O+W_+N+S", _
            '                               "Strand_+N", "Strand_+N+O", "Strand_+N+O+S", "Strand_+N+O+W", "Strand_+N+S+W", "Strand_+N+W", "Strand_+O", "Strand_+O+S", "Strand_+O+S+W", "Strand_+S", "Strand_+S+W", "Strand_+W", "Strand_+N+O+S+W", "STRAND_+N+S", "STRAND_+O+W"})
            '    UebergaengeLaden("KUESTE")
            '    SekundärAusrichtungslandschaften = New String() {"STRAND"}
            Case Else
                TexturenLaden(New String() {"Strand", "Strand+N", "Strand+N+O", "Strand+N+O+S", "Strand+N+O+W", "Strand+N+S+W", "Strand+N+W", "Strand+O", "Strand+O+S", "Strand+O+S+W", "Strand+S", "Strand+S+W", "Strand+W", "Strand+N+O+S+W", "STRAND+N+S", "STRAND+O+W"})
                UebergaengeLaden("Strand")
        End Select

        Normal = 0
        Ausrichtungslandschaften = New String() {"OEDLAND", "EBENE", "TEMPWERFT", "TEMPFLUGHAFEN", "PLASMA", "FEUER", "METEOR", "OEDLAND", "RUINE", "SUMPF", "WALD", "BERG", "STRASSE", "WUESTE", "PIPELINE", "EBENE+SCHROTT", "HQ", "STADT", "BASIS", "WERFT", "FLUGHAFEN", "TURM", "SCHWEISSNAHT", "LASER", "MONOLITH", "MAUER", "PIPE", "PIPESCHWEISS", "FABRIK", "KAPUTTEPIPESCHWEISS", "KAPUTTESCHWEISSNAHT", "KAKTEEN", "FELSEN", "AUSGETROCKNETESFLUSSBETT", "PFAD", "FLUSS", "MINIGESCHUETZ+N", "MINIGESCHUETZ+O", "MINIGESCHUETZ+S", "MINIGESCHUETZ+W", "SCHWARZE GESCHUETZ+N", "SCHWARZE GESCHUETZ+O", "SCHWARZE GESCHUETZ+S", "SCHWARZE GESCHUETZ+W", "VULKAN", "FESTUNG", "OMEGARAKETE", "ZUGBRUECKE", "MINE", "WUESTE+SCHROTT", "SCHNEE+SCHROTT", "RAKETENSILO+RAKETE", "RAKETENSILO", "SCHNEE", "KIEFERN", "GIPFEL", "STRASSENFROST", "PLINEKAPUTT", "PLINE", "PLINESCHWEISS", "SCHOCKLASER+N", "SCHOCKLASER+O", "SCHOCKLASER+S", "SCHOCKLASER+W"}



        If DataSettings.draw3D Then
            Ini3D()
        End If
    End Sub

    Public Overrides Function DrawSpecialStyle(ByVal BildID As Integer, ByVal Fog As Nebelarten, ByVal Alpha As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal TerrainUntergrundID As Integer, ByVal TerrainUntergrundBildID As Integer, ByVal TerrainUntergrundID2 As Integer, ByVal TerrainUntergrundBildID2 As Integer, Optional ByVal FixedLocation As Boolean = False, Optional ByVal Top As Boolean = False) As Boolean
        Select Case DataSettings.TerrainStyle
            Case TerrainStyle.CommanderWars2
                Return DrawTerrainUndUntergrund(Alpha, Fog, BildID, X, Y, 0, 0, TerrainUntergrundID, TerrainUntergrundBildID, TerrainUntergrundID2, TerrainUntergrundBildID2, FixedLocation, Top)
            Case Else
                Return DrawTerrainUndUntergrund(Alpha, Fog, BildID, X, Y, ObjektLandschaft.Frame, 4, TerrainUntergrundID, TerrainUntergrundBildID, TerrainUntergrundID2, TerrainUntergrundBildID2, FixedLocation, Top)
        End Select
    End Function

    Public Overrides Sub Malen3D(ByVal p_MatCube As Microsoft.DirectX.Matrix, ByVal Landschaft As ObjektLandschaft)



        Dim standardMatrix As Matrix = Grafikengine.Grafikkarte.Transform.World
        'Grafikengine.Grafikkarte.Transform.World = p_MatCube
        Objekt3D.SpielerFarbe = ObjektmarkiertesFeld.getFeldFarbe(Landschaft.KooX, Landschaft.KooY)
        Mesh.Malen(p_MatCube)
        Grafikengine.Grafikkarte.Transform.World = standardMatrix

        Malen3D(p_MatCube, "SEE", Landschaft)

    End Sub

    Public Overrides Sub Ini3D()
        Mesh = New Objekt3D
        Mesh.MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Strand.X")
    End Sub

    Public Overrides Sub Tick()

    End Sub

    Public Overrides Function GetTerrainUntergrund() As String()
        Return New String() {"SEE"}
    End Function
End Class
